<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html>
<html>

<head>
    <title>团队列表</title>
</head>

<body>

<div id="wrapper">
    <div class="gray-bg">
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox">
                        <div class="ibox-content">
                            <div class="search-area">
                                <form role="form" class="form-inline" id="queryform">
                                    <input type="hidden" id="idcard" name="idcard" value="${idcard}" class="form-control form-filter">
                                </form>
                            </div>
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover dataTables" id="data-table"></table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</div>

<!-- Page-Level Scripts -->
<script>
    $(document).ready(function () {

        var setting = {
            "ajax": {
                "url": "${ctx}/medical/team/list",
                "type": "POST"
            },
            "columns": [
                {"title": "团队名称", "data": "teamName", "width": "10%", "orderable": true},
                {"title": "团队人数", "data": "memberCount", "width": "10%", "orderable": false},
                {"title": "签约人数", "data": "signCount", "width": "10%", "orderable": false},
                {"title": "服务街道", "data": "streets", "width": "15%", "orderable": false},
                {"title": "操作", "data": null, "width": "8%", "orderable": false},
            ],
            "columnDefs": [
                {
                    "targets": 4,
                    "render": function (data, type, row, meta) {
                        if(data.hasChosen){
                            return "<p>已选择</p>";
                        }else{
                            return "<a class='btn-xs default btn-editable' href='${ctx}/medical/team/switch?id=" + data.teamId + "'>选择</a>";
                        }
                    },
                    "orderable": false
                }
            ],
            "order": [
                [0, "desc"]
            ],
        };
        /* Init DataTables */
        $('#data-table').DataTable(ehconfig.get_datatable_config(setting));
        submitFilter = function () {
            $('#data-table').DataTable().draw();
        }

    });

</script>


</body>

</html>
